package com.atguigu.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MVCConfig implements WebMvcConfigurer {


    /**
     *
     * 发送一个请求，跳转一个页面
     * Springmvc viewController 将请求和页面映射
     * @return
     *
     * @GetMapping("login.html")
     * public String loginPage(){
     *      return "login";
     * }
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/reg.html").setViewName("reg");
//        WebMvcConfigurer.super.addViewControllers(registry);
    }
}
